<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js"></script>
  <title>Document</title>
</head>

<body>
  <div id="App">
    <!-- 
      .stop         阻止事件冒泡传播 e.stopProgation
      .prevent      阻止默认事件  e.preventDefault
      .self         只有自身触发 不会冒泡事件?
      .capture      将事件类型改为冒泡
      .once         只触发一次 触发之后解绑事件
     -->
    <div class="box1" @click.capture.stop="clickOuter">
      wrapper
      <div class="box2" @click.self="clickInner">
        inner
        <div class="box3" @click.once="clickContent">
          content
        </div>
      </div>
    </div>
  </div>
  <script>
    const vm = new Vue({
      el: '#App',
      data () {
        return {}
      },
      methods: {
        clickOuter () {
          console.log('outer')
        },
        clickInner () {
          console.log('inner')
        },
        clickContent () {
          console.log('content')
        },
      },
    })
  </script>
</body>

<style>
  .box1 {
    width: 300px;
    height: 300px;
    border: 1px solid #333;
  }

  .box2 {
    width: 200px;
    height: 200px;
    border: 1px solid #333;
  }

  .box3 {
    width: 100px;
    height: 100px;
    border: 1px solid #333;
  }
</style>

</html>